const { MongoClient} = require('mongodb');
// Connection URL
const url = 'mongodb://121.36.200.5:10050';
const client = new MongoClient(url);
const dbName = 'admin';
async function main() {
  await client.connect();
  console.log('Connected successfully to server');
  const db = client.db(dbName);
  const collection = db.collection('user');
  const result = await collection.find({}).toArray();
  return result;
}
module.exports = main;